/*
 * @Author: fangquan
 * @Date: 2020-6-19 10:00:00
 * @Last Modified by: fangquan
 * @Last Modified time: 2020-6-19 10:00:00
 * @Usage 状态管理同步方法
 */

 import * as types from "./types";

 export default {
  //  设置用户信息
  [types.SET_USER_INFO](state, userInfo = {}) {
    state.userInfo = userInfo;
    localStorage.setItem('userInfo', JSON.stringify(userInfo));
  },

  // 设置access_token
  [types.SET_ACCESS_TOKEN](state, access_token) {
    state.access_token = access_token;
    localStorage.setItem('access_token', access_token);
  },

  // 设置AppId
  [types.SET_APP_ID](state, appId) {
    state.appId = appId;
    localStorage.setItem('appId', appId);
  }
 }

